package leetcode.weekly.week293;

//Solution3Test
public class Solution3 {

	public int largestCombination(int[] candidates) {
		int[] hash = new int[32];
		for (int i = 0; i < candidates.length; i++) {
			int num = candidates[i];
			int p = 0;
			while (num > 0) {
				int last = (num & 1);
				if (last == 1) {
					hash[p]++;
				}
				num >>= 1;
				p++;
			}
		}
		int ans = 0;
		for (int i = 0; i < hash.length; i++) {
			ans = Math.max(ans, hash[i]);
		}
		return ans;
	}

}
